package com.cskaoyan.javase.oop2._1extends._9override.exercise;

/**
 * 读程序题
 * @since 17:37
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class Demo {
    public static void main(String[] args) {
        Son s = new Son();
        // Son s2 = new Son(888);
        // Father fs = new Son();
        // Father f = new Father();
    }
}

class Father {
    int num = 10;

    public int getNum() {
        return num;
    }

    public Father() {
        System.out.println(getNum());
    }
}

class Son extends Father {
    int num = 100;

    {
        num = 1000;
    }

    @Override
    public int getNum() {
        return num;
    }

    public Son() {
    }

    public Son(int num) {
        this.num = num;
    }
}
